Skip to content

feat: expose assault metrics via Micrometer/Prometheus (#46) - #51

Merged
ErwanLT merged 3 commits into
mainfrom
46-feat-expose-metrics-via-micrometer-prometheus
Sep 22, 2026
Merged

ErwanLT merged 3 commits into
mainfrom
46-feat-expose-metrics-via-micrometer-prometheus

Conversation

@ErwanLT

@ErwanLT ErwanLT commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Closes #46

Optional quarkus-goblin-metrics module exposing the assault activity as Micrometer metrics.

What's included

  • New AssaultObserver SPI on the engine, notified on every recorded assault and on every active-state change. Observer failures are caught and never alter the request path — reused later by the OpenTelemetry (feat: OpenTelemetry tracing integration #47) and post-assault assertions (feat: post-assault assertions (resilience verification) #50) work.
  • GoblinMetricsObserver bean registering:
    • goblin_active — functional gauge over engine.isActive() (1/0),
    • goblin_assaults_total — counter tagged type + source (server, rest-client, webclient),
    • goblin_latency_injected_seconds — latency histogram tagged source (p99/min/max derivable from the _bucket series).
  • source is derived from the history identifier.
  • Tests: 7 unit (plain registry) + 6 integration (live Prometheus scrape, delta-based over a PT1S step).
  • Docs: new metrics page, README sections, compatibility note, roadmap tick.

Notes

  • The metrics module depends on quarkus-micrometer-registry-prometheus because quarkus-micrometer alone does not provide a backend.
  • Prometheus _max is interval-based by design (like http_server_requests_seconds_max); documented in the metrics page.

Build verified: ./mvnw clean verify (runtime · runtime-dev · metrics · integration-tests · docs), formatter clean.

Add an optional quarkus-goblin-metrics module that surfaces the assault
activity as Micrometer metrics on any backend:

- new AssaultObserver SPI on the engine, notified on every recorded
  assault and on every active-state change (observers errors are never
  propagated); reused later by the OpenTelemetry and assertion work.
- GoblinMetricsObserver bean registers goblin_active (functional gauge),
  goblin_assaults_total (counter, tags type+source) and
  goblin_latency_injected_seconds (latency histogram, tag source).
- source tag derived from the history identifier: server, rest-client,
  webclient.

Documentation: new metrics page, README sections, compatibility note and
roadmap tick; integration tests cover the live Prometheus scrape.
@ErwanLT
ErwanLT requested a review from a team as a code owner September 22, 2026 06:29
@ErwanLT ErwanLT linked an issue Sep 22, 2026 that may be closed by this pull request
@ErwanLT ErwanLT self-assigned this Sep 22, 2026
Add dedicated engine unit tests showing that an observer throwing on
notification never breaks recordAssault or setActive, and that healthy
observers still receive their notifications alongside failing ones.

Also clarify in the metrics docs that Micrometer names keep dots while
the Prometheus export sanitizes them to underscores.

@ErwanLT ErwanLT left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved

@ErwanLT
ErwanLT merged commit bbf4610 into main Sep 22, 2026
2 checks passed
@ErwanLT
ErwanLT deleted the 46-feat-expose-metrics-via-micrometer-prometheus branch September 22, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: expose metrics via Micrometer / Prometheus

1 participant